import request from "../index";
import { version } from "@/config";

// 获取产品 评价列表
export function productCommentList({ current = 1, goodsId }) {
  let pageSize = 10,
    offset = (current - 1) * pageSize + 1;
  const data = { goodsId, offset, pageSize };
  return request({
    url: `/ssop/api/order-v${version}/applets/evaluate/list`,
    method: "post",
    data,
  });
}

// 产品详情下，获取产品各规则产品
export function productGoodsList({goodsId, useDate, distributorMobile = ""}) {
  return request({
    url: `/ssop/api/goods-v${version}/goods-extend/goodsDetail`,
    method: "get",
    params: {
      goodsId,
      useDate,
      distributorMobile
    }
  });
}

// 定制游
export function customTour(data) {
  return request({
    url: `/ssop/api/cms-v${version}/tripCustom/save`,
    method: "post",
    data: {
      ...data,
      type: 2
    }
  });
}